Component({
  properties: {
    dynamicValues: {
      type: Array,
      value: ['']
    },
    key: {
      type: [Number, String],
      value: ''
    }
  },
  data: {},
  methods: {
    changeAddInput ({ target: { dataset: { index } }, detail: { value } }) {
      this.setData({
        [`dynamicValues[${index}]`]: value
      })
      this.triggerEvent('change', { data: this.data.dynamicValues, key: this.data.key })
    },
    delFormArray ({ currentTarget: { dataset: { index } } }) {
      this.data.dynamicValues.splice(index, 1)
      this.setData({
        dynamicValues: this.data.dynamicValues
      })
      this.triggerEvent('change', { data: this.data.dynamicValues, key: this.data.key })
    }
  }
})